<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  div {
    width: 500px;
    line-height: 60px;
  }
</style>

<body>
  <div>
    <span class="result"></span>
  </div>
  <button class="btn">点击发送</button>

  <script src="ajax.js">  </script>


  <script>
    url1 = 'http://timemeetyou.com:8889/api/private/v1/login';
    const url2 = 'http://mi.futurefe.com/api/products';
    let con = {
      categoryId: "100012",
      pageSize: "14"
    }
    let user = {
      password: "123456",
      username: "admin"
    }
    document.querySelector('.btn').onclick = function () {
      console.log(33333);
      $ajax({
        url: url1,
        method: 'post',
        data: user,
        success(res) {
          console.log(res);
        },
        error(err) {
          console.log(err);
        }
      })
      $ajax({
        url: url2,
        params: con,
        success(res) {
          console.log(res);
        },
        error(err) {
          console.log(err);
        }
      })
    }

  </script>
</body>

</html>